package com.gitee.feizns.explore.data_structure.array.easy;

import java.util.Stack;

/**
 * @author feizns
 * @since 2020/3/2
 */
public class FindSpecialInteger {

    public static void main(String[] args) {
        System.out.println(1 ^ 2);
//        System.out.println(findSpecialInteger(new int[]{1, 1, 2, 3, 4, 5, 6, 7,1}));
    }

    public static int findSpecialInteger(int[] arr) {
        double l = arr.length / 4.0;
        int n = 1;
        int c = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if ( arr[i] == c )
                n++;
            if ( n >= l )
                return c;
        }
        return c;
    }

}
